package org.example.maven.service.Impl;

import com.github.pagehelper.PageHelper;
import org.example.maven.mapper.LoginLogMapper;
import org.example.maven.pojo.operation.loginLog.AddLoginLog;
import org.example.maven.pojo.operation.loginLog.LoginLogList;
import org.example.maven.pojo.operation.loginLog.SearchLoginLog;
import org.example.maven.service.LoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoginLogServiceImpl implements LoginLogService {
    @Autowired
    private LoginLogMapper loginLogMapper;


    @Override
    public List<LoginLogList> getLoginLog(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return loginLogMapper.getLoginLog();
    }

    @Override
    public List<LoginLogList> getAllLogging() {
        return loginLogMapper.getLoginLog();
    }

    @Override
    public Integer getLoginLogCount(SearchLoginLog searchLoginLog) {
        return loginLogMapper.getLoginLogCount(searchLoginLog);
    }

    @Override
    public void addLoginLog(AddLoginLog addLoginLog) {
        loginLogMapper.addLoginLog(addLoginLog);
    }

    @Override
    public void deleteLoginLog(String[] id) {
        loginLogMapper.deleteLoginLog(id);
    }

    @Override
    public List<LoginLogList> getSpecieLoginLog(SearchLoginLog searchLoginLog,Integer pageNum,Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return loginLogMapper.getSpecieLoginLog(searchLoginLog);
    }

    @Override
    public void deleteLoginLogAll() {
        loginLogMapper.deleteLoginLogAll();
    }
}
